package org.ying.container.aop;

import net.sf.cglib.proxy.Enhancer;

import java.util.Map;


public class CglibProxyFactory extends ProxyFactory {
    @Override
    public <T> T proxy(T target, AspectInfo[] aspectInfos) {
        final Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(target.getClass());
        enhancer.setCallback(new CglibMethodInterceptor(target, aspectInfos));
        return (T) enhancer.create();
    }
}
